public class Originator {

    private String currentName;
    private int currentNo;
    private int cno1;
    public Originator() {
    }

    public Originator(String name, int no,int no1) {

        this.currentName = name;
        this.currentNo = no;
        this.cno1=no1;
    }

    public Memento createMemento(){
        return new Memento(this);
    }

    public boolean restoreStateByMemento(Memento memento){
        this.currentName = memento.getNameState();
        this.currentNo = memento.getNoState();
        this.cno1=memento.getNo1State();
        return true;

    }


    public String getCurrentName() {
        return currentName;
    }

    public void setCurrentName(String currentName) {
        this.currentName = currentName;
    }

    public int getCurrentNo() {
        return currentNo;
    }

    public void setCurrentNo(int currentNo) {
        this.currentNo = currentNo;
    }
    public int getCno1() {
        return cno1;
    }

    public void setCno1(int cno1) {
        this.cno1 = cno1;
    }
    @Override
    public String toString() {
        return "姓名：" + this.currentName + ";" + "年龄：" + this.currentNo + ";" + "学号：" + this.cno1;
    }
}
